home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TOS Silver 2000
/
TOS Silver 2000.iso
/
Anwendun
/
Pflaster
/
STEINMT.LST
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
File List
|
2000-04-30
|
24.5 KB
|
1,279 lines
REM STEINETTM 2.1.1 GFA 3.6 30.4.0 ogg
' w0
$m39300
DEFWRD "a-z"
ap_id=APPL_INIT()
pfm$=" PflasterMuster "
IF @t<>0
~MENU_REGISTER(ap_id,pfm$)
~SHEL_WRITE(9,1,0,CHR$(0),CHR$(0))
ENDIF
INTIN(0)=1
VDISYS 102,1,0
pu=INTOUT(4)
wb=WORK_OUT(0)
wh=WORK_OUT(1)
IF @c<>0
pfad$=CHR$(GEMDOS(25)+65)+":"+DIR$(0)+"\"
ELSE
pfad$="E:\GFA\STEINE\"
' pfad$="K:\STEINE\"
RESERVE (39300)
ENDIF
IF XBIOS(44,-1)=44 OR GEMDOS(68,L:-1,1)<0
a_st=1
ENDIF
IF RSRC_LOAD(pfad$+"STEIN.RSC")=0
~FORM_ALERT(1,"[2][ WO IST MEINE | RESOURCE?][ GRUMPH ]")
END
ENDIF
~RSRC_GADDR(0,0,rsc%)
~RSRC_GADDR(0,1,vers%)
~RSRC_GADDR(0,2,ende%)
~RSRC_GADDR(0,3,wahl%)
~RSRC_GADDR(0,4,stqm%)
DIM w(1,29),a(7),b(7),s(84,56),e$(11),x(84,56),q#(9),o$(21)
FOR f=0 TO 9
READ w(0,f)
NEXT f
FOR f=0 TO 3
READ w(1,f)
NEXT f
FOR f=1 TO 11
READ e$(f)
NEXT f
FOR f=0 TO 21
READ o$(f)
NEXT f
jax=1028
jay=726
jbx=1008
jby=688
jty=2100
menh=19
~VQT_EXTENT(pfm$,fx,fy,fv,fw,bx,by,bv,bw)
IF by-fy<10 AND (pu=4 OR pu=2)
menh=11
ENDIF
wmx=wb+1
wmy=wh-(menh-1)
w(0,1)=menh
w(0,2)=MIN(w(0,2),wmx)
w(0,3)=MIN(w(0,3),wmy)
w(0,7)=wh-140
w(0,11)=menh
w(0,12)=MIN(wmx,jax)
w(0,13)=MIN(wmy,jay)
w(0,14)=MIN(wmx,jax)
w(0,15)=MIN(wmy,jay)
w(1,11)=menh
w(1,12)=w(0,12)
w(1,13)=w(0,13)
adr_1%=V:a(0)
adr_2%=V:b(0)
ABSOLUTE m1,adr_1%
ABSOLUTE m4,adr_1%+6
ABSOLUTE m5,adr_1%+8
ABSOLUTE m6,adr_1%+10
ABSOLUTE m7,adr_1%+12
ABSOLUTE m8,adr_1%+14
~GRAF_MOUSE(0,0)
~MENU_BAR(rsc%,1)
~MENU_IENABLE(rsc%,40,0)
w1=WIND_CREATE(&X100100100101111,wb,wh,w(0,12),w(0,13))
w2=WIND_CREATE(&X100100111101111,wb,wh,w(1,12),w(1,13))
han=w1
wti
~WIND_OPEN(han,w(0,0),w(0,1),w(0,2),w(0,3))
~WIND_GET(han,4,wx,wy,wv,ww)
~WIND_GET(han,5,wx,by,wv,ww)
witi=wy-by
ab
ws156
z$=pfad$+o$(13)
IF EXIST(z$)<>0
d$=SPACE$(7007)
BLOAD z$,V:d$
fh=INSTR(d$,CHR$(13))
info$=LEFT$(d$,fh-1)
istt=fh+4
hin(9999)
zmax=f
ELSE
~MENU_IENABLE(rsc%,37,0)
nxhp=1
ENDIF
INTIN(0)=0
INTIN(1)=5
VDISYS 39,2,0
DEFTEXT 1,,,13
DEFFILL ,2,7
stein=1
COLOR 1
ON ERROR GOSUB f
ON BREAK GOSUB ade
f:
REPEAT
fre%=FRE(0)
~EVNT_TIMER(230)
evt_1=EVNT_MULTI(&X10011,2,1,1,0,0,0,0,0,0,0,0,0,0,adr_1%,0,x,y,k,f,yy,zz)
IF BTST(evt_1,0)<>0
~WIND_GET(han,10,fx,fy,fv,fw)
han(fx)
tast
ENDIF
IF BTST(evt_1,1)<>0 AND mini=0 AND wan=0
han(WIND_FIND(x,y))
sub
IF icon<>0
IF x>0 AND x<72 AND y>0 AND y<72 AND zz=2
icn(1)
ENDIF
ELSE
butt
ENDIF
ENDIF
IF BTST(evt_1,4)<>0
IF m1=10
~WIND_GET(han,10,fx,fy,fv,fw)
han(fx)
menu
ELSE
han(m4)
event
ENDIF
ENDIF
UNTIL qui<>0
CLEAR
END
DEFFN t=INT{ADD({ADD(GB,4)},2)}<>1
DEFFN c=BYTE{ADD(BASEPAGE,256)}<>96
DEFFN b=wb-@v+1
DEFFN h=wh-@w+1
DEFFN hs=ah DIV 16-1
DEFFN v=w(wan,0)+1
DEFFN w=w(wan,1)+witi
DEFFN vi=(mini=0 AND icon=0)
DEFFN xv=wx-@v
DEFFN xw=wy-@w
DEFFN x=x DIV 12+xmo
DEFFN y=y DIV 12+ymo
DATA 0,19,720,540,300,20,32,0,72,72,10,25,635,400
DATA 1*1 STEIN ,1.5*1 STEIN ,0.5*1 STEIN ,1*0.5 STEIN ,1*1.5 STEIN ,0.75*1 STEINL
DATA 0.75*1 STEINR,1*0.75 STEINO,1*0.75 STEINU,1.5*0.5 STEIN,0.5*1.5 STEIN
DATA ,STEIN LĂ–SCHEN,BLOCK ,BLOCK ANFANG ,BLOCK ENDE ,
DATA KREIS ,KREISMITTE ,,,,RECHNE Y:,KEIN SPEICHER
DATA STEININF.TXT,MUSTER,*.PFM,*.UIX,*.BMP, laden..., speichern...,- INFO ,PFLASTER
r:
DATA 19,19,31,19,7,19,19,7,19,31,13,19,19,19,19,13,19,19,31,7,7,31
> PROCEDURE tast
ascii=BYTE(yy)
SELECT yy
CASE &H3002
mini
CASE &H1709
icn(0)
CASE &H1011
ade
DEFAULT
IF @vi
SELECT yy
CASE &H7700
wof
CASE &H180F
@v("",1,o$(15),o$(18))
CASE &H1F13
@v(o$(14),2,o$(15),o$(19))
CASE &H2F76,&H2F56
form(vers%)
CASE &H1414
q_m
DEFAULT
SELECT wan
CASE 1
SELECT yy
CASE &H1C0D,&H720D
wex2
CASE &H4D00
wty=MIN(1000,wty+sty)
ws_9_2
CASE &H4B00
wty=MAX(1,wty-sty)
ws_9_2
CASE &H4800
wty=MAX(1,wty-1000/(zmax-@hs))
ws_9_2
CASE &H5000
wty=MIN(1000,wty+1000/(zmax-@hs))
ws_9_2
ENDSELECT
CASE 0
IF ascii>48 AND ascii<60
stein=ascii-48
TEXT 167,0,e$(stein)
CLR block,losch,kreis
ELSE
SELECT yy
CASE &H4D00
wsx=MIN(1000,wsx+sbx)
ws_8_1
CASE &H4B00
wsx=MAX(1,wsx-sbx)
ws_8_1
CASE &H4800
wsy=MAX(1,wsy-sby)
ws_9_1
CASE &H5000
wsy=MIN(1000,wsy+sby)
ws_9_1
CASE &H3062,&H3042
b
CASE &H2E63,&H2E43
c
CASE &H1769,&H1749,&H6200
IF nxhp=0 AND (wop2=0 OR (wop2=1 AND han=w1))
info
ENDIF
CASE &H256B,&H254B
k
CASE &H266C,&H264C,&H7030,&HB30
@l
CASE &H310E
n
CASE &H1372,&H1352
g
CASE &H1F73,&H1F53
s
CASE &H1615
uix
CASE &H1117
bmp
' CASE &H1910
CASE &H260C
lk
ENDSELECT
ENDIF
ENDSELECT
ENDSELECT
ENDIF
ENDSELECT
RETURN
> PROCEDURE butt
SUB y,16
IF x>-1 AND x<ab AND y>-1 AND y<ah-16
ON block+1 GOSUB w1,xx,w1
IF block=2
y=@y+1
x=@x+1
j=0
FOR w=y TO MIN(56,y+x(0,1)-1)
INC j
i=0
FOR v=x TO MIN(84,x+x(1,0)-1)
INC i
f=x(i,j)
g=(v-1)*12+2-xmo*12
h=(w-1)*12+2+16-ymo*12
IF f>0
s(v,w)=f
p(f)
ENDIF
NEXT v
NEXT w
ELSE IF block=1
IF x<MIN(ab-23,983) AND y<MIN(ah-23,663)
v=@x+1
w=@y+1
x=(v-xmo-1)*12
y=(w-ymo-1)*12+16
sttx(4)
~EVNT_TIMER(410)
~WIND_GET(w1,4,wx,wy,wv,ww)
REPEAT
evt_2=EVNT_MULTI(&X100011,1,1,1,0,0,0,0,0,0,0,0,0,0,adr_2%,0,r,s,k,f,yy,zz)
~GRAF_RUBBERBOX(@v+x,@w+y,12,12,i,j)
UNTIL (r>x+12 AND r<MIN(@v+1007,MIN(wb,wx+wv)) AND s>y+12 AND s<MIN(@w+671,MIN(wh,wy+ww)) AND BTST(evt_2,1)<>0) OR BTST(evt_2,0)<>0
r=(r-@v) DIV 12+1+xmo
s=(s-@w-16) DIV 12+1+ymo
ARRAYFILL x(),0
x(1,0)=r-v
x(0,1)=s-w
j=0
FOR y=w TO MIN(56,s-1)
INC j
i=0
FOR x=v TO MIN(84,r-1)
INC i
x(i,j)=s(x,y)
NEXT x
NEXT y
block=2
sttx(2)
~EVNT_TIMER(230)
ENDIF
ELSE
IF kreis=1
k_anz=MIN(17,k_anz+1)
IF k_anz=0
kr_x=x+xmo*12
kr_y=y+ymo*12
ENDIF
CLIP MAX(0,@v),MAX(0,@w+16),MIN(ab,@b),MIN(ah,@h)-16 OFFSET @v,@w+16
kr_mal
clp
TEXT 167,0,o$(6)+STR$(k_anz)+" "
IF k_anz=17
kreis=0
ENDIF
~EVNT_TIMER(230)
ELSE
g=@x*12+2-xmo*12
h=@y*12+2+16-ymo*12
IF losch=1 AND @x<84 AND @y<56
fy=s(@x+1,@y+1)
IF fy>0
q(fy)
h(fy)
fb=9
IF fy=6 OR fy=8
fb=3
ENDIF
DEFLINE -10922
FOR r=h-2 TO h+r2-fb STEP 12
LINE g-2,r,g+r1+2,r
NEXT r
FOR s=g-2 TO g+r1-fb STEP 12
LINE s,h-2,s,h+r2+2
NEXT s
s(@x+1,@y+1)=0
ENDIF
ELSE
s(MIN(84,@x+1),MIN(56,@y+1))=stein
p(stein)
TEXT 1,17,@x+1
TEXT 1,33,@y+1
ENDIF
ENDIF
ENDIF
ON block+1 GOSUB w0,xx,w0
ENDIF
RETURN
> PROCEDURE menu
~MENU_TNORMAL(rsc%,m4,1)
SELECT m5
CASE 25
ade
CASE 41
mini
CASE 42
icn(0)
DEFAULT
IF @vi
SELECT m5
CASE 9
form(vers%)
CASE 18
@v("",1,o$(15),o$(18))
CASE 20
@v(o$(14),2,o$(15),o$(19))
CASE 38
q_m
CASE 43
full
DEFAULT
IF wan=0
SELECT m5
CASE 22
uix
CASE 23
bmp
CASE 27 TO 35
ON m5-26 GOSUB s,l,b,c,k,lk,xx,g,n
CASE 37
info
' CASE 40
ENDSELECT
ENDIF
ENDSELECT
ENDIF
ENDSELECT
RETURN
> PROCEDURE event
SELECT m1
CASE 20
ab
r(m5,m6,m7,m8,1)
CASE 21
wtop
CASE 22
IF han=w1
ade
ELSE
wex2
ENDIF
CASE 23
IF mini=0
full
ELSE
mini
ENDIF
CASE 24
~WIND_GET(han,8,sx,sv,sv,sw)
~WIND_GET(han,9,sy,sv,sv,sw)
SELECT m5
CASE 0
IF han=w1
wsy=MAX(1,sy-sby)
ws_9_1
ELSE
wty=MAX(1,sy-sty)
ws_9_2
ENDIF
CASE 1
IF han=w1
wsy=MIN(1000,sy+sby)
ws_9_1
ELSE
wty=MIN(1000,sy+sty)
ws_9_2
ENDIF
CASE 2
wty=MAX(1,sy-1000/(zmax-@hs))
ws_9_2
CASE 3
wty=MIN(1000,sy+1000/(zmax-@hs))
ws_9_2
CASE 4
wsx=MAX(1,sx-sbx)
ws_8_1
CASE 5
wsx=MIN(1000,sx+sbx)
ws_8_1
ENDSELECT
CASE 25
IF han=w1
wsx=m5
ws_8_1
ENDIF
CASE 26
IF han=w1
wsy=m5
ws_9_1
ELSE
wty=m5
ws_9_2
ENDIF
CASE 27
IF @vi
ful
w(wan,2)=MAX(320,MIN(jax,m7))
w(wan,3)=MAX(100,MIN(jay,m8))
ab
ws
ENDIF
CASE 28
w(wan,0)=m5
w(wan,1)=m6
ws
CASE 34
icn(34)
CASE 36
mini
CASE 50
exi=1
ade
ENDSELECT
RETURN
'
> PROCEDURE s
CLR block,losch,kreis
form(wahl%)
IF ro<12
stein=ro
ENDIF
r(@v,@w,ab-1,15,0)
RETURN
> PROCEDURE l
CLR block,kreis
losch=1
sttx(1)
RETURN
> PROCEDURE b
CLR losch,kreis
block=1
sttx(3)
RETURN
> PROCEDURE c
IF x(1,0)<>0
block=2
sttx(2)
ENDIF
RETURN
> PROCEDURE k
CLR block,losch
kreis=1
k_anz=-1
sttx(7)
RETURN
> PROCEDURE sttx(f)
TEXT 167,0,o$(f)
RETURN
> PROCEDURE lk
CLR kreis,k_anz
red
RETURN
> PROCEDURE g
FOR s=1 TO 56
g=82*12+2
h=(s-1)*12+2+16
IF s(83,s)=2
p(1)
s(83,s)=1
ENDIF
NEXT s
FOR s=1 TO 56
fx=s(84,s)
g=83*12+2
h=(s-1)*12+2+16
IF fx=5
p(11)
s(84,s)=11
ELSE IF fx=1 OR fx=2 OR (fx>5 AND fx<10)
p(3)
s(84,s)=3
ENDIF
NEXT s
FOR r=1 TO 84
g=(r-1)*12+2
h=54*12+2+16
IF s(r,55)=5
p(1)
s(r,55)=1
ENDIF
NEXT r
FOR r=1 TO 84
fx=s(r,56)
g=(r-1)*12+2
h=55*12+2+16
IF fx=2
p(10)
s(r,56)=10
ELSE IF fx=1 OR (fx>4 AND fx<10)
p(4)
s(r,56)=4
ENDIF
NEXT r
RETURN
> PROCEDURE n
ARRAYFILL s(),0
CLR losch,kreis,k_anz
red
RETURN
> PROCEDURE h(stn)
IF stn=7
ADD g,6
SUB r1,6
ELSE IF stn=9
ADD h,6
SUB r2,6
ENDIF
RETURN
> PROCEDURE q(stn)
RESTORE r
FOR f=1 TO stn
READ r1,r2
NEXT f
h(stn)
DEFFILL 0
PBOX g-2,h-2,g+r1+2,h+r2+2
RETURN
> PROCEDURE p(stn)
q(stn)
DEFFILL 1
PBOX g,h,g+r1,h+r2
RETURN
> PROCEDURE q_m
ARRAYFILL q#(),0
FOR s=1 TO 16
FOR r=1 TO 16
t=s(r,s)
IF t>0
IF t=10
ADD q#(2),0.5
ELSE IF t=11
ADD q#(5),0.5
ELSE IF (r=16 XOR s=16) AND t=1
ADD q#(1),0.5
ELSE IF r=16 AND s=16 AND t=1
ADD q#(1),0.25
ELSE IF r=16 AND t=4
ADD q#(4),0.5
ELSE IF s=16 AND t=3
ADD q#(3),0.5
ELSE IF r=16 AND s=16 AND (t=2 OR t=5)
ADD q#(t),0.1666666666667
ELSE IF r=16 AND s=15 AND t=5
ADD q#(5),0.3333333333333
ELSE IF s=15 AND t=5
ADD q#(5),0.6666666666667
ELSE IF s=16 AND t=5
ADD q#(5),0.3333333333333
ELSE IF r=16 AND t=5
ADD q#(5),0.5
ELSE IF r=15 AND s=16 AND t=2
ADD q#(2),0.3333333333333
ELSE IF r=15 AND t=2
ADD q#(2),0.6666666666667
ELSE IF r=16 AND t=2
ADD q#(2),0.3333333333333
ELSE IF s=16 AND t=2
ADD q#(2),0.5
ELSE
INC q#(t)
ENDIF
ENDIF
NEXT r
NEXT s
ADD q#(2),q#(5)
ADD q#(3),q#(4)
q#(4)=q#(6)+q#(7)+q#(8)+q#(9)
FOR f=1 TO 4
q#(f)=ROUND(q#(f),2)
t$=STR$(q#(f))
CHAR{OB_SPEC(stqm%,f+1)}=t$
NEXT f
form(stqm%)
RETURN
'
> PROCEDURE pbx0
DEFFILL 0
PBOX 0,0,ab,ah
RETURN
> PROCEDURE box32(b2,b3,bx,by,bv,bw)
DEFFILL 0
IF bx<0
bx=ABS(bx)
PBOX bx-1,by-1,bv+1,bw+1
ELSE
PBOX bx,by,bv,bw
ENDIF
clbox(b2,b3,bx,by,bv,bw)
clbox(b2,b3,bx+1,by+1,bv-1,bw-1)
RETURN
> PROCEDURE clbox(b2,b3,bx,by,bv,bw)
DEFLINE b2
DRAW bx+1,bw-2 TO bx+1,bw-3 TO bx,bw-3 TO bx,by+3 TO bx+1,by+3 TO bx+1,by+1
DRAW TO bx+3,by+1 TO bx+3,by TO bv-3,by TO bv-3,by+1 TO bv-2,by+1
DEFLINE b3
DRAW bx+2,bw-1 TO bx+3,bw-1 TO bx+3,bw TO bv-3,bw TO bv-3,bw-1 TO bv-1,bw-1
DRAW TO bv-1,bw-3 TO bv,bw-3 TO bv,by+3 TO bv-1,by+3 TO bv-1,by+2
RETURN
> PROCEDURE kr_mal
DEFLINE 1
DEFFILL 0
PCIRCLE kr_x-xmo*12,kr_y-ymo*12,MIN(420,12+k_anz*24)
FOR f=k_anz DOWNTO 0
CIRCLE kr_x-xmo*12,kr_y-ymo*12,MIN(420,12+f*24)
NEXT f
RETURN
> PROCEDURE mm
evt_2=EVNT_MULTI(&X110011,1,1,1,0,0,0,0,0,0,0,0,0,0,adr_2%,0,x,y,k,f,yy,zz)
sub
RETURN
> PROCEDURE sub
SUB x,@v
SUB y,@w
RETURN
> PROCEDURE ade
IF exi=0
form(ende%)
ENDIF
IF ro=1 OR exi<>0
IF wop2<>0
~WIND_CLOSE(w2)
ENDIF
~WIND_DELETE(w2)
~WIND_CLOSE(w1)
~WIND_DELETE(w1)
~MENU_BAR(rsc%,0)
~RSRC_FREE()
qui=1
ENDIF
RETURN
> PROCEDURE f
TEXT 1,0,"~~~~~ERROR: "+STR$(ERR)
ON ERROR GOSUB f
RESUME f
RETURN
> PROCEDURE info
IF wop2<>0 AND han=w1
han(w2)
wtop
ELSE IF wop2=0
hi=1
han(w2)
ws156
wop2=1
wop(w2,1)
ENDIF
RETURN
> PROCEDURE hin(fh)
hn=istt
FOR f=1 TO fh
c=INSTR(hn,d$,CHR$(13))
EXIT IF c=0
hn=c+2
NEXT f
RETURN
'
> PROCEDURE han(hw)
han=hw
wan=0
IF han=w2
wan=1
ENDIF
ab
RETURN
> PROCEDURE ab
ab=w(wan,2)-2
ah=w(wan,3)-(witi+1)
IF icon=0
SUB ab,18
SUB ah,18
ENDIF
RETURN
> PROCEDURE wex2
~WIND_CLOSE(w2)
~MENU_IENABLE(rsc%,37,1)
han(w1)
wop2=0
RETURN
> PROCEDURE full
FOR f=0 TO 3
SWAP w(wan,f),w(wan,f+10)
NEXT f
ab
ful=-ful+1
ws
IF (w(wan,2)<w(wan,12) OR w(wan,3)<w(wan,13)) AND w(wan,0)=w(wan,10) AND w(wan,1)=w(wan,11)
red
ENDIF
RETURN
> PROCEDURE ful
IF ful=1
w(wan,12)=w(0,14)
w(wan,13)=w(0,15)
w(wan,10)=0
w(wan,11)=menh
ful=0
ENDIF
RETURN
> PROCEDURE mini
IF icon=0
IF wop2=1 AND mini=0
~WIND_CLOSE(w2)
ENDIF
~WIND_CLOSE(w1)
~WIND_DELETE(w1)
IF mini=0
~GRAF_SHRINKBOX(w(0,0),w(0,1),w(0,4),w(0,5),w(0,0),w(0,1),w(0,2),w(0,3))
w1=WIND_CREATE(&X1111,wb,wh,w(0,14),w(0,15))
ELSE
~GRAF_GROWBOX(w(0,0),w(0,1),w(0,2),w(0,3),w(0,0),w(0,1),w(0,4),w(0,5))
w1=WIND_CREATE(&X100100100101111,wb,wh,w(0,12),w(0,13))
ENDIF
ful
SWAP w(0,2),w(0,4)
SWAP w(0,3),w(0,5)
mini=-mini+1
han(w1)
wop(w1,0)
IF mini=0
ws156
IF wop2=1
wop(w2,1)
ENDIF
ENDIF
ENDIF
RETURN
> PROCEDURE icn(icn)
IF mini=0
IF wop2=1 AND icon=0
~WIND_CLOSE(w2)
ENDIF
~WIND_CLOSE(w1)
~WIND_DELETE(w1)
IF icon=0
IF icn<34
~GRAF_SHRINKBOX(w(0,6),w(0,7),w(0,8),w(0,9),w(0,0),w(0,1),w(0,2),w(0,3))
ENDIF
w1=WIND_CREATE(&X1001,wb,wh,w(0,14),w(0,15))
ELSE
~GRAF_GROWBOX(w(0,0),w(0,1),w(0,2),w(0,3),w(0,6),w(0,7),w(0,8),w(0,9))
w1=WIND_CREATE(&X100100100101111,wb,wh,w(0,12),w(0,13))
ENDIF
ful
FOR f=0 TO 3
SWAP w(0,f),w(0,f+6)
NEXT f
IF icn=34 AND icon=0
w(0,0)=m5
w(0,1)=m6
w(0,2)=m7
w(0,3)=m8
ENDIF
wan=0
ab
icon=-icon+1
wop(w1,0)
IF icon=0
ws156
IF wop2=1
wop(w2,1)
ENDIF
ENDIF
ENDIF
RETURN
> PROCEDURE ws156
IF han=w1
sbx=1000 DIV (jbx/ab)
sby=1000 DIV (jby/ah)
~WIND_SET(han,15,sbx,0,0,0)
~WIND_SET(han,16,sby,0,0,0)
~WIND_GET(han,8,wsx,sv,sv,sw)
xmo=wsx*((jbx-ab)/1000) DIV 12
~WIND_GET(han,9,wsy,sv,sv,sw)
ymo=wsy*((jby-ah)/1000) DIV 12
vsx=wsx
vsy=wsy
ELSE
sty=1000 DIV (jty/ah)
~WIND_SET(han,15,1000,0,0,0)
~WIND_SET(han,16,sty,0,0,0)
~WIND_GET(han,9,wty,sv,sv,sw)
vty=wty
ENDIF
RETURN
> PROCEDURE ws
~WIND_SET(han,5,w(wan,0),w(wan,1),w(wan,2),w(wan,3))
wti
ws156
clp
RETURN
> PROCEDURE ws_8_1
IF wsx<>vsx
vsx=wsx
~WIND_SET(w1,8,wsx,sv,sv,sw)
xmo=wsx*((jbx-ab)/1000) DIV 12
red
ENDIF
RETURN
> PROCEDURE ws_9_1
IF vsy<>wsy
vsy=wsy
~WIND_SET(w1,9,wsy,sv,sv,sw)
ymo=wsy*((jby-ah)/1000) DIV 12
red
ENDIF
RETURN
> PROCEDURE ws_9_2
IF vty<>wty
vty=wty
hi=wty DIV (1000/(zmax-@hs))
~WIND_SET(w2,9,wty,sv,sv,sw)
' tmo=wty*((jty-ah)/1000) DIV 16+1
red
ENDIF
RETURN
> PROCEDURE wop(wo,wp)
wti
~WIND_OPEN(wo,w(wp,0),w(wp,1),w(wp,2),w(wp,3))
clp
RETURN
> PROCEDURE wtop
~WIND_SET(han,10,han,0,0,0)
wti
RETURN
> PROCEDURE wti
IF icon=0
IF wop2=1
ttl$=pfm$+o$(20)+CHR$(0)+CHR$(0)
ttl%=V:ttl$
~WIND_SET(w2,2,CARD(SWAP(ttl%)),CARD(ttl%),0,0)
ENDIF
ttl$=pfm$+CHR$(0)+CHR$(0)
ELSE
ttl$=o$(21)+CHR$(0)+CHR$(0)
ENDIF
ttl%=V:ttl$
~WIND_SET(w1,2,CARD(SWAP(ttl%)),CARD(ttl%),0,0)
RETURN
> PROCEDURE clp
CLIP MAX(0,@v),MAX(0,@w),MAX(0,MIN(ab,@b)),MAX(0,MIN(ah,@h)) OFFSET @v,@w
RETURN
> PROCEDURE wof
IF wop2<>0
han(w2)
red
ENDIF
han(w1)
red
RETURN
> PROCEDURE red
ab
r(@v,@w,ab,ah,0)
RETURN
> PROCEDURE r(rx,ry,rb,rh,evnt)
wti
IF mini=0
w1
~WIND_GET(han,11,wx,wy,wv,ww)
WHILE wv+ww<>0
wv=wv+wx
ww=ww+wy
wx=MAX(wx,rx)
wy=MAX(wy,ry)
wv=MIN(wv,rx+rb)-wx
ww=MIN(ww,ry+rh)-wy
IF wv>0 AND ww>0
IF RC_INTERSECT(rx,ry,rb,rh,wx,wy,wv,ww)
CLIP wx,wy,MIN(wv,@b),MIN(ww,@h) OFFSET @v,@w
IF icon=0
IF han=w1
zeich
ELSE
hilfe
ENDIF
ELSE
box32(-10922,1,0,0,ab-1,ah-1)
' pbx0
FOR s=0 TO 5
g=(s MOD 3)*24+1
h=(s DIV 3)*24+4
p(1)
NEXT s
ENDIF
ENDIF
ENDIF
~WIND_GET(han,12,wx,wy,wv,ww)
WEND
w0
~WIND_GET(han,4,wx,wy,wv,ww)
clp
ENDIF
RETURN
> PROCEDURE zeich
pbx0
TEXT 1,0,"FRE: "+STR$(fre%)
TEXT 302,0,"+X: "+STR$(xmo)+" +Y: "+STR$(ymo)
wz=4
IF @xw<16
wz=16
ENDIF
fx=(@xv DIV 12)*12
fb=((@xv+wv) DIV 12)*12
fy=MAX(16,(@xw DIV 12)*12+wz-12)
fh=((@xw+ww-wz) DIV 12)*12+wz
DEFLINE -10922
FOR s=fy TO fh STEP 12
LINE fx,s,fb+11,s
NEXT s
FOR r=fx TO fb STEP 12
LINE r,fy,r,fh+11
NEXT r
IF block=0 AND losch=0 AND kreis=0
TEXT 167,0,e$(stein)
ELSE IF losch=1
sttx(1)
ELSE IF block>0
sttx(2)
ELSE IF kreis=1
IF k_anz=-1
sttx(7)
ELSE
TEXT 167,0,o$(6)+STR$(k_anz)
ENDIF
ENDIF
CLIP wx,MAX(@w+16,wy),MIN(wv,@b),MIN(ah-16,MIN(ww-hv,@h-16))
fy=MIN(MAX(MAX(-24,-ymo*12),(@xw DIV 12)*12-36),35*12+4)
fh=MIN(((@xw+ww) DIV 12)*12,55*12)
fx=MIN(MAX(MAX(-24,-xmo*12),(@xv DIV 12)*12-24),53*12)
fb=MIN(((@xv+wv) DIV 12)*12,83*12)
FOR s=fy TO fh STEP 12
FOR r=fx TO fb STEP 12
stn=s(MIN(84,r/12+1+xmo),MIN(56,s/12+1+ymo))
IF stn>0
g=r+2
h=s+2+16
p(stn)
ENDIF
NEXT r
NEXT s
IF k_anz>0
hv=0
IF wy<@w+16
hv=wy-@w
ENDIF
CLIP OFFSET @v,@w+16
kr_mal
ENDIF
RETURN
> PROCEDURE hilfe
IF evnt<>0
pbx0
TEXT 14,1,info$
DEFLINE -10922
LINE 0,17,ab,17
ENDIF
IF hi=1
hn=istt
ELSE
hin(hi-1)
ENDIF
FOR f=1 TO @hs
fh=INSTR(hn,d$,CHR$(13))
EXIT IF fh=0 OR hi+f>zmax
TEXT 1,f*16+4,SPACE$(ab DIV 8+1)
TEXT 1,f*16+4,MID$(d$,hn,fh-hn)
hn=fh+2
NEXT f
TEXT 1,f*16+4,SPACE$(ab DIV 8+1)
RETURN
'
> FUNCTION fsel$(a$,f$,z$)
IF INT{ADD({ADD(GB,4)},0)}<&H140
ro=FSEL_INPUT(f$,z$,f)
ELSE
ro=@fsel_ex(a$,f$,z$,f)
ENDIF
IF f=0 OR ro=0 OR z$=""
RETURN ""
ENDIF
FOR r=0 TO 9
EXIT IF MID$(f$,LEN(f$)-r,1)="\"
NEXT r
last$=LEFT$(f$,LEN(f$)-r)
RETURN last$+z$
ENDFUNC
> FUNCTION fsel_ex(a$,VAR f$,z$,f)
a$=a$+CHR$(0)
f$=f$+CHR$(0)+SPACE$(400)
z$=z$+CHR$(0)+SPACE$(150)
GCONTRL(0)=91
GCONTRL(1)=0
GCONTRL(2)=2
GCONTRL(3)=3
GCONTRL(4)=0
ADDRIN(0)=V:f$
ADDRIN(1)=V:z$
ADDRIN(2)=V:a$
GEMSYS
f$=CHAR{V:f$}
z$=CHAR{V:z$}
f=GINTOUT(1)
RETURN GINTOUT(0)
ENDFUNC
> PROCEDURE v(z$,zz,g$,a$)
IF last$=""
f$=pfad$+g$
ELSE
f$=last$+g$
ENDIF
a$=RIGHT$(g$,3)+a$
wti
f$=@fsel$(a$,f$,z$)
wti
IF f$<>""
SELECT zz
CASE 2
c$=SPACE$(4704)
i%=0
FOR s=1 TO 56
FOR r=1 TO 84
f=s(r,s)
BYTE{V:c$+i%}=BYTE(f)
INC i%
NEXT r
NEXT s
OPEN "O",#1,f$
BPUT #1,V:c$,4704
CLOSE #1
CASE 1
IF EXIST(f$)<>0
OPEN "I",#1,f$
y%=LOF(#1)
IF y%=9408
FOR s=1 TO 56
FOR r=1 TO 84
BGET #1,V:f,2
s(r,s)=f
NEXT r
NEXT s
ELSE IF y%=4704
c$=SPACE$(4704)
BGET #1,V:c$,4704
i%=0
FOR s=1 TO 56
FOR r=1 TO 84
f=BYTE{V:c$+i%}
s(r,s)=f
INC i%
NEXT r
NEXT s
ENDIF
CLOSE #1
ENDIF
mm
wof
CASE 3,4
OPEN "O",#1,f$
BPUT #1,V:c$,LEN(c$)
BPUT #1,mal%,j%
CLOSE #1
ENDSELECT
ENDIF
CLR f$,z$,c$
RETURN
> PROCEDURE uix
y%=(ab-1) DIV 8+1
j%=y%*(ah-16)
IF @fre>j%+33000
mal%=@mal(j%)
w1
i%=0
u=y%*8-1
TEXT 140,0,o$(11)
FOR w=16 TO ah-1
TEXT 220,0,w
FOR v=0 TO u
IF v<ab
t=POINT(v,w)
IF v MOD 8=0
s=7
f=0
ENDIF
f=f+t*(2^s)
ENDIF
IF s=0
BYTE{mal%+i%}=BYTE(f)
INC i%
ENDIF
DEC s
NEXT v
NEXT w
TEXT 140,0,o$(0)
w0
h=10
c$=SPACE$(6)
CARD{V:c$}=h
CARD{V:c$+2}=ab
CARD{V:c$+4}=ah-16
v("",3,o$(16),o$(19))
~MFREE(mal%)
ELSE
TEXT 1,0,o$(12)
ENDIF
RETURN
> PROCEDURE bmp
y%=(DIV(ab-1,32)+1)*32
u=y% DIV 8
j%=u*(ah-16)
IF @fre>j%+33000
mal%=@mal(j%)
w1
c$=SPACE$(62)
LSET c$="BM"
{V:c$+2}=@bits(j%+62)
CARD{V:c$+6}=0
CARD{V:c$+8}=0
{V:c$+10}=@bits(62)
{V:c$+14}=@bits(40)
{V:c$+18}=@bits(ab)
{V:c$+22}=@bits(ah-16)
CARD{V:c$+26}=@bit2(1)
CARD{V:c$+28}=@bit2(1)
{V:c$+30}=0
{V:c$+34}=@bits(j%)
{V:c$+38}=0
{V:c$+42}=0
{V:c$+46}=@bits(0)
{V:c$+50}=@bits(0)
FOR f=0 TO 1
BYTE{V:c$+54+f*4}=(-f+1)*255
BYTE{V:c$+55+f*4}=(-f+1)*255
BYTE{V:c$+56+f*4}=(-f+1)*255
BYTE{V:c$+57+f*4}=0
NEXT f
TEXT 140,0,o$(11)
FOR f=ah-1 DOWNTO 16
h=ah-1-f+16
TEXT 220,0,h
o%=(f-16)*u
FOR g=0 TO u DIV 2-1
i%=0
FOR y=15 DOWNTO 0
t=g*16+(-y+15)
IF t<ab
i=POINT(t,h)
IF BTST(i,0)<>0
i%=BSET(i%,y)
ENDIF
ENDIF
NEXT y
CARD{mal%+o%+g*2}=CARD(i%)
NEXT g
NEXT f
TEXT 140,0,o$(0)
w0
v("",4,o$(17),o$(19))
~MFREE(mal%)
ELSE
TEXT 1,0,o$(12)
ENDIF
RETURN
> FUNCTION bits(o%)
zx%=BYTE{V:o%}
zy%=SHL(BYTE{V:o%+1},8)
g%=SHL(BYTE{V:o%+2},16)
h%=SHL(BYTE{V:o%+3},24)
RETURN zx%+zy%+g%+h%
ENDFUNC
> FUNCTION bit2(zz)
zx%=BYTE{V:zz}
zy%=BYTE{V:zz+1}*2^8
RETURN zx%+zy%
ENDFUNC
> PROCEDURE w1
~WIND_UPDATE(1)
RETURN
> PROCEDURE w0
~WIND_UPDATE(0)
RETURN
> PROCEDURE xx
RETURN
> PROCEDURE form(o%)
wti
~FORM_CENTER(o%,fx,fy,fb,fh)
~OBJC_DRAW(o%,0,2,fx,fy,fb,fh)
~FORM_DIAL(0,0,0,0,0,fx,fy,fb,fh)
ro=FORM_DO(o%,0)
~FORM_DIAL(3,0,0,0,0,fx,fy,fb,fh)
~OBJC_CHANGE(o%,ro,0,fx,fy,fb,fh,0,0)
wti
' button: version=2;ende=1+2;wahl=1-11,12;stqm=1,2-5
RETURN
> FUNCTION fre
IF a_st<>0
RETURN MALLOC(-1)
ENDIF
zx%=GEMDOS(68,L:-1,0)
zy%=GEMDOS(68,L:-1,1)
RETURN MAX(zx%,zy%)
ENDFUNC
> FUNCTION mal(j%)
IF a_st<>0
RETURN MALLOC(j%)
ENDIF
RETURN GEMDOS(68,L:j%,3)
ENDFUNC